package com.example.springboot.excption;

import lombok.Getter;

/**
 * 功能:
 * 作者：jian
 * 日期：2024/3/16 19:19
 */

public class ServiceException extends RuntimeException {
    private final String code;

    public ServiceException(String msg) {
        super(msg);
        this.code = "500";//给它默认为500
    }


    public ServiceException(String code, String msg) {
        super(msg);
        this.code = code;
    }

    public String getCode() {
        return code;
    }
}